//创建一个路由器并暴露出去

//引入
import { createRouter,createWebHistory } from "vue-router";

import Home from '@/components/Home.vue'
import About from '@/components/About.vue'
import News from '@/components/News.vue'
import Detail from "@/components/detail.vue";

//创建路由器
const router = createRouter({
    history:createWebHistory(),
    routes:[
        {   name:'shouye',
            path:'/home',
            component:Home
        },
        {   name:'xinwen',
            path:'/about',
            component:About
        },
        {   name:'guanyu',
            path:'/news',
            component:News,
            children:[
				{
					name:'xiangqing',
					path:'detail',
					component:Detail
				}
			]
        }
    ]
})

//暴露出路由器
export default router